Image Resizer : API Documentation

Type SafeList<T>

Namespace ImageResizer.Collections

Interfaces IEnumerable<T>

SafeList is mutable, but it uses immutable data structures to minimize the need for locking. The provided manipulation Exposes a immutable list. Changes are made by copying the lists. SafeList is Never perform logic on SafeList directly, always use GetList() or GetCollection() first, followed by SetList(). If you need involved list-fu, use ModifyList and specify a callback. It will execute inside a lock, preventing changes on other threads from overwriting each other.

Events

Methods

Properties

Events

Changed

Public instance methods

void Add(T item)

void AddFirst(T item)

bool Contains(T item)

ReadOnlyCollection<T> GetCollection()

Returns an immutable snapshot of the collection

IList<T> GetList()

Returns a mutable snapshot of the list

void ModifyList(ListEditor callback)

void SetList(IEnumerable<T> list)

Replaces the current collection with a new one. (copied to ensure safety) Use ModifyList when modifying the list. Use this only when the previous or current state of the list is irrelevant.

Public properties

T First get;

Returns the first item in the list. May return null if the list is empty.

T Last get;

Returns the first item in the list. May return null if the list is empty.

IEnumerable<T> Reversed get;